home *** CD-ROM | disk | FTP | other *** search
/ Merciful 5 / Merciful - Disc 5.iso / software / r / real_3d / real3dv3.3b.dms / real3dv3.3b.adf / RPL.LZH / RPL / absskel.rpl next >
Text File  |  1995-05-01  |  2KB  |  99 lines

  1. (
  2. ( This program removes the displacement between a skeleton joint and an 
  3. ( inverse kinem. curve ie. sets VOFF tags to [0,0,0] for all objects whose
  4. ( parent object is INVKINEM object
  5. (
  6.  
  7. "objects.rpl" LOAD
  8. "locks.rpl" LOAD
  9. "tags.rpl" LOAD
  10.  
  11. ( this function goes through the sub objects of given object and clears
  12. ( all VOFF tags.
  13.  
  14. : AsClearVOFF
  15.     PARAM
  16.         VARIABLE aObject
  17.     ENDPARAM
  18.  
  19.     ( loop through sub objects of the given object
  20.     aObject FETCH O_GETSUB 
  21.     BEGIN 
  22.         DUP 
  23.     WHILE 
  24.         DUP 
  25.         IF
  26.             DUP "VOFF" O_FETCHTAG DUP 
  27.             IF
  28.                 0 0 0 4 ROLL VSTORE
  29.             ELSE
  30.                 DROP
  31.             ENDIF
  32.         ENDIF
  33.         O_GETNEXT 
  34.     REPEAT
  35.     DROP
  36. ;
  37.  
  38. : AsVOFF
  39.     PARAM 
  40.         VARIABLE aObject
  41.     ENDPARAM
  42.  
  43.     aObject FETCH "SMTH" O_FETCHTAG DUP    ( is this an animation method 
  44.     IF
  45.         "INV KINEMATIC" COMPARE NOT        ( yes, is it inv kinem. object
  46.         IF
  47.             aObject FETCH AsClearVOFF      ( yes, handle param curves
  48.         ENDIF
  49.     ELSE
  50.         DROP
  51.     ENDIF
  52. ;
  53.  
  54. ( Recursively handle given object
  55.  
  56. : AsHandleObject
  57.     PARAM 
  58.         VARIABLE aObj
  59.     ENDPARAM
  60.  
  61.     aObj FETCH AsVOFF
  62.  
  63.     aObj FETCH O_GETSUB
  64.     BEGIN DUP WHILE
  65.         DUP AsHandleObject
  66.         O_GETNEXT 
  67.     REPEAT
  68.     DROP
  69. ;
  70.  
  71.  
  72. ( Re-establish selected objects
  73.  
  74. : AsMakeAbsolute
  75.  
  76.     ( Lock object data 
  77.     iLOCK_SHARED O_LOCK
  78.  
  79.     ( fetch selected objects on stack
  80.     O_GETSEL
  81.  
  82.     ( scan through selected objects and call 'ReEstabl'
  83.     BEGIN 
  84.         DUP 
  85.     WHILE
  86.         AsHandleObject
  87.     REPEAT
  88.     DROP
  89.  
  90.     ( release object data
  91.     iLOCK_REMOVE O_LOCK
  92. ;
  93.  
  94. ( call Re-Establish when this file is loaded
  95. AsMakeAbsolute
  96.  
  97. ( Get rid of ReEstablish
  98. FORGET AsClearVOFF
  99.